import json
import os


def init_config(filepath="./config.json"):
    config = {
        "config_position":[
            os.path.abspath('./config.json'),
        ],
        "nodes":{
            "self":{
                "id":"0"*10,
                "ip":"localhost",
                "port":8000
            }
        },
        "database":{
            "lsqlite3":{
                "username":"yuang",
                "password":"qweasd",
            }
        }
    }
    content = json.dumps(config,indent=4)
    with open(filepath,'w') as config_json:
        config_json.write(content)

if __name__ == '__main__':
    init_config("../config.json")